import request from "@/utils/request/request.ts";

/**
 * 统一的API响应类型
 * @author linyn
 * @date 2025/10/28 13:34
 */
export interface ApiResponse<T = any> {
  code: number;
  data: T;
  message: string;
  success: boolean;
}
/**
 * request-utils
 * @author linyn
 * @date 2025/10/28 13:34
 */
export default class RequestUtils {
  /**
   * post请求
   * @param url 请求地址
   * @param params 请求参数
   * @author linyn
   * @date 2025/10/28 13:34
   */
  static async post<T = any, R = any>(url: string, params: T): Promise<ApiResponse<R>> {
    return await request.post(url, params);
  }
}
